package handler

import (
	"git.oschina.net/fanbuchi/scf-server/domain"
	"github.com/gin-gonic/gin"
	"net/http"
)

func HandlerResponse(c *gin.Context,data interface{}, err error){
	var rsp domain.Rsp
	if err!=nil {
		rsp=domain.Rsp{Code:http.StatusBadRequest,Msg:err.Error()}
	}else {
		rsp=domain.Rsp{Code:http.StatusOK,Data:data}
	}
	c.JSON(http.StatusOK,rsp)
}
